package com.orphan.supplier.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.orphan.supplier.po.Back;
import com.orphan.supplier.po.Supplierorder;
import com.orphan.supplier.mapper.SupplierorderMapper;
import com.orphan.supplier.service.ISupplierorderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.orphan.supplier.vo.SupplierVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zjm
 * @since 2021-07-14
 */
@Service
public class SupplierorderServiceImpl extends ServiceImpl<SupplierorderMapper, Supplierorder> implements ISupplierorderService {
    @Resource
    private SupplierorderMapper supplierorderMapper;
    @Override
    public List<Supplierorder> findAll() {
        return supplierorderMapper.findAll();
    }

    @Override
    public PageInfo<Supplierorder> findByItem(Integer pageNO) {
        PageHelper.startPage(pageNO, PAGESIZE);
        PageInfo pageInfo = PageInfo.of(supplierorderMapper.findByItem());
        return pageInfo;
    }

    @Override
    public void addOrder(Supplierorder supplierorder) {
        supplierorderMapper.insert(supplierorder);
    }


}
